COMMOBJ=scanner.cmo parser.cmo 
COMPOBJ=builtin.cmo check.cmo compile.cmo main.cmo
INTPOBJ=interpret.cmo
HEADERS=type.cmi operator.cmi sast.cmi ast.cmi parser.cmi
BUILDS=mcsli mcslc

all: mcslc

mcslc: mcslc.ml $(HEADERS) $(COMMOBJ) $(COMPOBJ)
	ocamlc -o $@ $(COMMOBJ) $(COMPOBJ) mcslc.ml

mcsli: mcsli.ml $(HEADERS) $(COMMOBJ) $(INTPOBJ)
	ocamlc -o $@ $(COMMOBJ) $(INTPOBJ) mcsli.ml

# Borland won't accept "%.cmo: %.ml" type targets, uses old fashioned suffix
# targets
.ml.cmo:
	ocamlc -c $<

.mli.cmi:
	ocamlc -c $<

.mly.mli:
	ocamlyacc $<

.mly.ml:
	ocamlyacc $<

.mll.ml:
	ocamllex $<

clean:
	-rm -f *.cm? $(BUILDS) parser.ml parser.mli scanner.ml

.SUFFIXES: .ml .mll .mly .mli .cmi .cmo
